import { CommandInvoker } from './api'

const bot = (original: TemplateStringsArray, ...args: string[]) => {
    // 只处理原始数据
    let command = '';
    original.forEach((item, index) => {
        command += item;
        command += args[index] || '';
    });
    return String(CommandInvoker.invoke(command.split(' ')));
}

declare global {
    var bot: (original: TemplateStringsArray, ..._: string[]) => string;
}
global.bot = bot;